package com.app.main.controller;

import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

import com.app.main.domain.Main;

public class MainValidator implements Validator {

	@Override
	public boolean supports(Class<?> cls) {
		return Main.class.isAssignableFrom(cls);
	}

	@Override
	public void validate(Object target, Errors errors) {
		Main main = (Main) target;
		
		errors.rejectValue("user", "required");
		errors.rejectValue("password", "required");
	}

}
